package com.koron.housing.workflow;

import com.koron.bean.base.Response;
import com.koron.bean.workflow.SubmitterParam;
import com.koron.bean.workflow.WorkflowPluginController;
import com.koron.bean.workflow.WorkflowUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jzp
 * @since 2022/3/8
 */
@RestController
@RequestMapping("housingWorkflow")
public class HousingWorkflowController implements WorkflowPluginController {
    @Autowired
    private StaffHelper staffHelper;

    /**
     * 取交集
     */
    @Override
    public Response<List<WorkflowUser>> submitter(@RequestBody SubmitterParam submitterParam) {
        return Response.ok(staffHelper.mixed(submitterParam.getUsers()));
    }

    @Override
    public Response<List<WorkflowUser>> handler(@RequestBody SubmitterParam submitterParam) {
        return Response.ok(staffHelper.mixed(submitterParam.getUsers()));
    }

}
